home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / 80X86 / ASMFAQ.ZIP / ASM_FAQ4.TXT < prev    next >
Encoding:
Internet Message Format  |  1996-04-03  |  25.2 KB

  1. From news.primenet.com!nntp.news.primenet.com!news.sprintlink.net!gryphon.phoenix.net!academ!binky.capnet.state.tx.us!goblin.tdh.state.tx.us!geraldo.cc.utexas.edu!cs.utexas.edu!howland.reston.ans.net!nntp.coast.net!zombie.ncsc.mil!news.mathworks.com!newsfeed.internetmci.com!sgigate.sgi.com!news1.best.com!news.aimnet.com!ns2.mainstreet.net!sloth.swcp.com!news.dgsys.com!DGS.dgsys.com!raymoon Tue Apr  2 15:45:00 1996
  2. Path: news.primenet.com!nntp.news.primenet.com!news.sprintlink.net!gryphon.phoenix.net!academ!binky.capnet.state.tx.us!goblin.tdh.state.tx.us!geraldo.cc.utexas.edu!cs.utexas.edu!howland.reston.ans.net!nntp.coast.net!zombie.ncsc.mil!news.mathworks.com!newsfeed.internetmci.com!sgigate.sgi.com!news1.best.com!news.aimnet.com!ns2.mainstreet.net!sloth.swcp.com!news.dgsys.com!DGS.dgsys.com!raymoon
  3. From: raymoon@dgsys.com (Raymond Moon)
  4. Newsgroups: alt.lang.asm,comp.lang.asm.x86,news.answers,alt.answers,comp.answers
  5. Subject: x86 Assembly Language FAQ - General Part 3/3
  6. Supersedes: <4gdsmm$o9c@news.dgsys.com>
  7. Followup-To: alt.lang.asm,comp.lang.asm.x86
  8. Date: 21 Mar 1996 22:50:42 GMT
  9. Organization: MoonWare
  10. Lines: 593
  11. Approved: news-answers-request@MIT.EDU
  12. Distribution: world
  13. Expires: Sat, 20 Apr 1996 23:59:59 GMT
  14. Message-ID: <4ismg2$2tq@news.dgsys.com>
  15. Reply-To: raymoon@moonware.dgsys.com
  16. NNTP-Posting-Host: dgs.dgsys.com
  17. Summary: This is the FAQ for the x86 Assembly Language programmers for the
  18.  alt.lang.asm and comp.lang.asm.x86 newsgroups.  This particular section of
  19.  the FAQ is part three of three parts that contain x86 assembly language
  20.  information common to all assemblers.
  21. Keywords: x86 Assemby Language ASM FAQ General
  22. X-Newsreader: TIN [version 1.2 PL2]
  23. Xref: news.primenet.com alt.lang.asm:8422 comp.lang.asm.x86:18599 news.answers:66832 alt.answers:16274 comp.answers:17531
  24.  
  25. Archive-name: assembly-language/x86/general/part3
  26. Posting-Frequency: monthly (21st of every month)
  27. Last-modified: 1996/03/19
  28.  
  29. ------------------------------
  30.  
  31. Subject: 25. Shareware Assemblers
  32.  
  33. 25.1  AVAILABILITY
  34.  
  35. All assemblers, unless otherwise noted, listed here are available from
  36. SimTel in the SimTel/msdos/asmutil directory.  Specifically:
  37.  
  38.     ftp://ftp.coast.net/SimTel/msdos/asmutil
  39.  
  40. 25.2  A86
  41.  
  42. This assembler is a very capable assembler for 89286 and earlier
  43. processors.  Registration will get you a version capable of handling 80386
  44. processor.  For more details, see the A86 section of this FAQ.
  45.  
  46. 25.3  CHASM, CHASM4.ZIP
  47.  
  48. This assembler was the first shareware assembler available.  CHASM was
  49. written Mr. David Whitman.  The current version available is version 4 and
  50. dated in 1983.  This version supports only 8088 processor, and the output
  51. only is:
  52.     .com file (.exe is not supported)
  53.     BLOADable - format for interpreted BASIC to load and execute
  54.     External procedure for TurboPascal - TurboPascal version not given
  55.  
  56. The version available on the internet is annoyware and crippleware.  For
  57. $40 registration fee, you will get the complete version without the
  58. annoying banner page.  This version supports macros, conditional assembly,
  59. include files, operand expressions and structures.
  60.  
  61. I do not recommend this assembler because of it limited capability and it
  62. is very out of date.
  63.  
  64. 25.4  THE ARROWSOFT ASSEMBLER, VALARROW.ZIP
  65.  
  66. This assembler is the public domain version of the Professional Arrowsoft
  67. Assembler by Arrowsoft Systems, Inc.  The version is 1.00d and is dated in
  68. 1986.  This assembler is a MASM 3.0 compatible assembler and supports up to
  69. 80286 processor.  Compared to the Professional version, the public domain
  70. version has one major limitation.  The file input size is limited to 64K
  71. bytes.
  72.  
  73. The file also includes a public domain linker, full screen editor and an
  74. EXE2BIN clone program.
  75.  
  76. The above version 1.00d is available from SimTel.  Version 2.00c which has
  77. only the assembler and documentation is available:
  78.     http://sunsite.unc.edu/pub/micro/pc-stuff/freedos/microc/arrowasm.zip
  79. and the linker separately:
  80.     http://sunsite.unc.edu/pub/micro/pc-stuff/freedos/microc/vallink.zip
  81. These are used in the freeDOS project.
  82.  
  83. 25.5  WOLFWARE ASSEMBLER, WASM202.ZIP
  84.  
  85. This assembler was written by Mr. Eric Tauck.  The latest version is 2.02
  86. and dates from 1987.  This assembler supports only the 8088 processor and
  87. assembles directly into a .com file.  It supports a simplified syntax and
  88. program structure so programs written for this assembler may not be
  89. compatible with other assemblers.  Several source files for programs are
  90. included with the .zip file.
  91.  
  92. 25.6 MAGIC ASSEMBLER, ASM110.ZIP                                    REVISED
  93.  
  94. This assembler is the very new.  The version is 1.10 and dates from March
  95. 1995.  This assembler was written by Mr. Bert Greevenbosch.  The output is
  96. either a .com file or a boot sector program.  The assembly commands are
  97. standard except for the jump and call commands.  Again, the source code
  98. will not be compatible with other assemblers.  Beware of version 1.04. 
  99. That version had a bug that when executed without the print command, the
  100. assembler terminated with a runtime error.  This is corrected in subsequent
  101. versions.
  102.  
  103. Changes made in version 1.10 are:
  104.     CALLF [] added, CALL [] corrected   Boot Indicator (55aa) added
  105.     [BX][SI] now recognized as [BX+SI]  Calculations (*, /, -, +) added
  106.     XCHG added                          Assembling Report added
  107.     EQU bug corrected                   IN/OUT command improved
  108.  
  109. 25.7 GEMA, GEMA.ZIP
  110.  
  111. This assembler revision is 2.6a with a date, 4 Jan 96.  It is different
  112. from all other x86 assemblers I have seen.  This assembler is based upon
  113. Motorola's 68k mnemonics and logical structure.  All instuctions, Pentium
  114. Pro and known undocumented are supported.  GEMA was designed especially for
  115. 32-bit porcessing.  The assembler will take only one source code file and
  116. will output an .com or .exe file.  No linker is required.  DESA.EXE, a beta
  117. GEMA disassembler is available in the GEMA package. ASM2GEMA.EXE, a TASM to
  118. GEMA translator is no longer availabe as part of the GEMA package.  An
  119. interactive real and protected-mode debugger is in progress.
  120.  
  121. This assembler is available from:
  122.     ftp://ftp.nether.net/pub/gema/gema.zip  (symbolic link to latest
  123.                                              version)
  124. 25.8 NASM 0.1, NASM.ZIP
  125.  
  126. The birth of this assembler started out of a thead that started on
  127. comp.lang.asm.x86.  When you download this assembler, you get the source
  128. code in ANSI C.  The web page devoted to this assembler is:
  129.  
  130.     http://www.dcs.warwick.ac.uk/~jules/nasm1.html
  131.  
  132. The assembler is available for downloading from this web page.
  133.  
  134. 25.9 GAS, GNU Assembler
  135.  
  136. This assembler with many object-file utilities will run on 386 systems
  137. running the following operating systems: AIX 386BSD, NetBSD, BSDI/386,
  138. Linux, SCO, Unixware, DOS/DJGPP.  The below file is a gzipped tar file. 
  139. You will not gzip and tar programs to uncompress and extract the files.
  140. The assembler and utilities are part of the GNU binutils file.  This file,
  141. a 3.86 Mbyte file, is available from:
  142.  
  143.     ftp://prep.ai.mit.edu/pub/gnu/binutils-2.6.tar.gz
  144.  
  145. 25.10 REAL TOOLS 1.0 (BETA), RTOOLS.ZIP
  146.  
  147. This assembler is dated in Dec 93 and is a beta test.  The nice thing about
  148. this assembler is that it comes with its own DOS-windowing IDE.  This
  149. assembler was written by Internationa Systems development.  The instruction
  150. set supported is 486 including protected mode instructions, but some holes
  151. do exist.  This assembler has a unique way of supporting macros.  32-bit
  152. supported.  On line help and debugger are available with registered
  153. product.
  154.  
  155. 25.11 ENHANCED ASSEMBER, EASM.ZIP                                       NEW
  156.  
  157. This is version 1.0a of the above assembler.  This assembler supports all
  158. standard commands (there was a small and not inclusive list of standard
  159. commands in the documentation), as well as an enhanced command set - Very
  160. non standard.  This assembler is available from:
  161.  
  162.     http://pwp.usa.pipeline.com/~spyder_x/easm.zip
  163.  
  164. The home page:
  165.     http://pwp.usa.pipeline.com/~spyder_x/easm.htm
  166.  
  167. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  168. Last changed: 18 Mar 96
  169.  
  170. ------------------------------
  171.  
  172. Subject: 26. WWW Assembly HomePages
  173.  
  174. 26.1  CAUTION
  175.  
  176. All of the web sites listed here are maintained by individuals.  I will
  177. strive to maintain this list current but do not be surprised if the
  178. addresses no longer are current.
  179.  
  180. 26.2 ASSEMBLY LANGUAGE RELATED HOME PAGES
  181.  
  182. Assembly Language Resources
  183.     http://www.cera.com/assembly.htm
  184.  
  185. Assembly Language Tutorial
  186.     http://udgftp.cencar.udg.mx/ingles/tutor/Assembler.html
  187.     http://www.cit.ac.nz/smac/csware.htm
  188.         Version 2.6 of on-line 386 assembly languager course.  Self tests, 
  189.             assignments, course notes, and software are included.
  190.     http://www.feldspar.com/~mbabcock/Programming/asmtut1.htm
  191.         Mike Babcock's ASM Tutorial
  192.  
  193. Hardware Systems
  194.     http://www.cit.ac.nz/smac/cbt/hwsys/default.htm
  195.         Good links to general asm information.  Links to iAPX386
  196.             information.
  197.  
  198. Robert Collins' home pages (all of these are in the process of moving. 
  199. These are then new addresses.  Everything may not be working yet.)
  200.     http://www.x86.org/
  201.         Collins' home page
  202.     http://www.x86.org/undoc
  203.         Intel Secrets - undocumented OpCodes, links to Intel's on-line
  204.             documentation, the infamous Appendix H, P6 OpCodes, and much,
  205.             much more  
  206.     http://www.x86.org/mrbios/mrbios.html
  207.         Shareware BIOS
  208.     http://www.x86.org/articles/articles.html
  209.         Growing list of on-line Intel documentation and magazine articles
  210.             by Robert Collins and Ralf Brown
  211.     http://www.x86.org/P6/P6.html
  212.         Pentium Pro Information including New Opcodes, Paging Extension,
  213.             CPUID and manuals.
  214.     http://www.x86.org/articles/pmbasics
  215.         Protected Mode Basic - a tutorial on PM with souce code.
  216.  
  217. Christian Ludloff's 80x86.CPU home page
  218.     http://www.x86.org/4p/
  219.     http://webusers.anet-dfw.com/~ludloff                           REVISED
  220.         This home page includes new information about many Intel processors
  221.             and their clones.  This information is of interest to system
  222.             software authors.
  223.  
  224. Jannes Faber's Assembly home page
  225.     http://www.fys.ruu.nl/~faber/Amain.html
  226.         List of ASM Books with short reviews
  227.         A few hints and tricks
  228.         Complete source code to some of his programs
  229.         A listing of EMS Professional Shareware products
  230.  
  231. Ray Rose's Html For Assembler home page
  232.     http://www.alaska.net/~rrose/assembly.htm
  233.         An extensive list of ASM books without descriptions
  234.         Links to alt.lang.asm, comp.lang.asm.x86, and alt.msdos.programmer
  235.             newsgroups.
  236.         Link to the Yahoo/Computers and Internet/Languages/Assembly page
  237.             (see below)
  238.  
  239. NASM: The Netwide Assembler Project
  240.     http://www.dcs.warwick.ac.uk/~jules/nasm1.html
  241.         A group of programmers are writing a new assembler.  This home page
  242.             describes the project and where to download the latest version.
  243.  
  244. Michael Babcock's 3/4/586 ASM Programming Home Page
  245.     http://www.feldspar.com/~nbabcock/Programming/pIndex.html
  246.         This home page has links to:
  247.             Optimizing 803/4/586 ASM Programming
  248.                 http://www.feldspar.com/~mbabcock/Programming/Optimize.html
  249.             ASM Tutorial
  250.                 http://www.feldspar.com/~mbabcock/Programming/asmtut1.htm
  251.             Utilities
  252.                 http://www.feldspar.com/~mbabcock/Programming/Utils.html
  253.  
  254. The Official Web Shareware Site
  255.     http://www.jumbo.com/prog/dos/asmutil
  256.         This site appears to have a few asm files not on SimTel.
  257.  
  258. Hamarsoft 86BUGS list Online
  259.     http://www.xs4all.nl/~feldmann/
  260.         List contains many documented and undocumented errors in Intel
  261.             microprocessors, as well as undocumented instructions.
  262.  
  263. Joe's Assembly Language Page
  264.     http://jasper.idbsu.edu:8000/
  265.         Links to his own and other asm code.
  266.         His own Assembly Language Search Engine
  267.  
  268. Bill Stapleton's Assembly Language Reference Page
  269.     http://hamton.eng.ua.edu:80/college/people/wstablet/ee384.html
  270.         A collection of 80x86 assembly language references generating from
  271.             teaching EE383 and EE384 courses at The University of Alabama.
  272.         
  273. Dr. ASM's Assembly Home Page
  274.     http://web.syr.edu/~dbgrandi/assembly.htm
  275.         Some answered questions and links to other assembly related sites.
  276.  
  277. 80xxx Snippets - A file site for 80x86 Assembly Language enthusiasts
  278.     http://www.poweramp.net/~jvahn/
  279.         Download snippets & Booklist
  280.  
  281. Arzie's Home Page - Many links to programming related pages and source code
  282.     http://www.mediaport.org/~arzie/
  283.  
  284. CERA Research Assembly Language Hot Lists and Major Resources
  285.     http://www.cera.com/assembly.htm
  286.         Links to FAQs and other web sites
  287.  
  288. Kip Irvine's Assembly Language Sources
  289.     http://netrunner.net/~irvinek/asm.htm
  290.  
  291. Arzie's Programming Page                                                NEW
  292.     http://www.mediaport.org/~arzie/programming/index.html
  293.  
  294. Gavin Estey's Home Page                                                 NEW
  295.     http://www.strangecreations.com/strange/index.html
  296.         His ASM tutorial and other ASM Links and FAQs
  297.  
  298. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  299. Last changed: 18 Mar 96
  300.  
  301. ------------------------------
  302.  
  303. Subject: 27. Undocumented OpCodes
  304.  
  305. 27.1  WHAT AND WHERE
  306.  
  307. Robert Collins has make available an excellent article on Intel
  308. Undocumented OpCodes.  Just set your web browser to:
  309.  
  310.     http://www.x86.org/secrets/OpCodes.html
  311.  
  312. 27.2  EXTENDED FORMS OF AAM AND AAD INSTRUCTIONS
  313.  
  314. Mr. Collins describes extended forms these two instructions.  AAM is ASCII
  315. Adjust after Multiplication, and ADD is ASCII Adjust before Division. 
  316. These instructions are knows as quick ways to divide and multiply by ten,
  317. as these instructions normally assemble with 10 as the default operand. 
  318. Using macros provided, any value from 0h to 0ffh can be substituted.  These
  319. instructions are available on all x86 Intel processors.
  320.  
  321. 27.3  SALC - SET AL ON CARRY
  322.  
  323. Mr. Collins describes this instruction a c programmers dream instruction
  324. for interfacing to assembly language procedures.  This instruction will set
  325. the AL register to 00h or 0ffh depending on whether the carry flag is clear
  326. or set, respectively.  This instruction is available on all x86 Intel
  327. processors.
  328.  
  329. 27.4  ICE RELATED OPCODES
  330.  
  331. Mr. Collins describes several instructions that appear whose existence
  332. makes debugging run-time code easier on the ICE debugger.  There are:
  333.     ICEBP   - ICE Break Point
  334.     UMOV    - User Move Data
  335.     LOADALL - Loads the Entire CPU State
  336.     
  337. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  338. Last changed: 4 Nov 95
  339.  
  340. ------------------------------
  341.  
  342. Subject: 28. Common Reason Why Memory Allocation Fails
  343.  
  344. 28.1 BACKGROUND
  345.  
  346. A common error received when first learning to use Int 21h Function 48h,
  347. allocate memory, is error code 8, insufficient memory available.  Usually,
  348. the programmer then writes a small program that only allocates memory, and
  349. the program still fails.  This situation is quite puzzling because there
  350. should be hundreds of kilobytes of memory available but this function
  351. reports that there is insufficient memory for a few hundred bytes.  The
  352. reason is that DOS generally allocates all available memory above the
  353. loaded program to that program.  Therefore, there is no more memory to
  354. allocate, so the request fails.
  355.  
  356. 28.2 .COM FILES
  357.  
  358. Since a .com file does not contain any header information, the DOS loader
  359. has no way of determining how much memory is required for a program beyond
  360. the physical size of the program.  Even this number is deceptive because it
  361. does not include a stack.  Therefore, DOS always allocates all available
  362. memory above the program to the program.
  363.  
  364. To use the allocate memory function, the programmer must release that extra
  365. memory using Int 21h Function 4ah, Set Memory Block Size.  Given that
  366. generally, there is more that 64 Kbytes of memory, the DOS sets Stack Top
  367. to just under that value, it is generally safe to release all memory above
  368. 64 Kbytes.
  369.  
  370. 28.3 .EXE FILES
  371.  
  372. The amount of memory the DOS allocates to the loaded program depends upon a
  373. value in the .exe header.  This value is called Maximum Allocation and is a
  374. word starting at offset 12.  This value specifies the number of 16-byte
  375. paragraphs beyond the image size wanted by the program to execute.  This
  376. value must be equal or greater that the Minimum Allocation, which is the
  377. number of 16-byte paragraphs beyond the image size required by the program
  378. to execute.  This space generally contains uninitialized variables and the
  379. stack.
  380.  
  381. The value of Maximum Allocation is set by the /CPARM Option for the
  382. Microsoft Linker.  By default, the linker sets this value to 0ffffh which
  383. will causes DOS to allocate the largest block of available memory.  This
  384. memory can be used as a heap, print buffer, etc.
  385.  
  386. 28.4 DETERMINING HOW MUCH MEMORY IS AVAILABLE TO A PROGRAM
  387.  
  388. In the PSP, at offset 02h, DOS loads a word which is the segment address of
  389. the next Memory Control Block or Arena.  Subtracting the PSP from that
  390. value at offset 02h will be the number of memory paragraphs allocated to
  391. the program.  The number of bytes can be calculate by shifting that number
  392. to the left by 4 bits, multiplying by 16, the size of a memory paragraph.
  393.  
  394. 28.5 HOW TO DEALLOCATE MEMORY AT THE START OF A PROGRAM
  395.  
  396. If you want to load and execute another program, you must release memory to
  397. make room for the program.  Also, since the largest chunk of memory is
  398. allocated already to the program, all requests to allocate memory generally
  399. fail.
  400.  
  401. Again, to use the allocate memory function, the programmer must release the
  402. extra memory above the program use as for a .com file above.  The problem
  403. here is where is the end of the program.  The answer is not as simple as
  404. with the .com file.  There are two basic solutions.
  405.  
  406. 1.  If you use the .dosseg option, the Microsoft Linker will define a
  407. label, _end, at the end of the DGROUP.  Since the .dosseg option also
  408. places any FAR data segments between the code and DGROUP segments, you can
  409. release all memory above that label.
  410.  
  411. 2.  If you do not want or are unable to use the first option, use an
  412. include file which declares all segments used by your program.  Define in
  413. the last segment, a label and use it as the _end label in the first
  414. example.
  415.  
  416. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  417. Last changed: 26 Dec 95
  418.  
  419. ------------------------------
  420.  
  421. Subject: 29. Volume Serial Numbers
  422.  
  423. 29.1 VOLUME SERIAL NUMBER FORMAT
  424.  
  425. The volume serial number was introduced with DOS 4.0 as part of an extended
  426. boot record and is created through you either FORMAT a disk or use DISKCOPY
  427. to create another disk.  The serial number is a function of the time/date
  428. of the formatting or the diskcopying.  Note that DISCOPY generates a new
  429. volume serial number so a DISKCOPY is not an exact image of the source
  430. diskette.
  431.  
  432. 29.2 CALCULATING THE VOLUME SERIAL NUMBER
  433.  
  434. For example, say a disk was formatted on 26 Dec 95 at 9:55 PM and 41.94
  435. seconds.  DOS takes the date and time just before it writes it to the disk.
  436.  
  437. Low order word is calculated:               Volume Serial Number is:
  438.     Month & Day         12/26   0c1ah
  439.     Sec & Hundrenths    41:94   295eh               3578:1d02
  440.                                 -----
  441.                                 3578h
  442.  
  443. High order word is calculated:
  444.     Hours & Minutes     21:55   1537h
  445.     Year                1995    07cbh
  446.                                 -----
  447.                                 1d02h
  448.  
  449. Note that DOS interrupt 21h Functions 2ah, Get DOS Date, and 2ch, Get DOS
  450. Time, are particularily suited to getting the date and time for calculating
  451. the Volume Serial Number. 
  452.  
  453. 29.3 READING AND SETTING THE VOLUME SERIAL NUMBER
  454.     
  455. To read the Volume Serial Number, use the IOCTL call, int 21h function
  456. 440dh Minor Code 66h, Get Media ID.  To write the Volume Serial Number, use
  457. the IOCTL call, int 21h function 440dh Minor Code 46h, Set Media ID.
  458.  
  459. WARNING!  These IOCTL calls use a structure that also contain the volume
  460. label and file system type.  So that you do not create errors with these
  461. values, I recommend that you always Minor Code 66h to initialize the
  462. structure before setting the Volume Serial Number to a new value and
  463. writing it back to the disk. 
  464.  
  465. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  466. Last changed: 17 Feb 96
  467.  
  468. ------------------------------
  469.  
  470. Subject: 30. .obj File Format
  471.  
  472. 30.1 INTEL
  473.  
  474. There are two sources for this information.  The first is available from
  475. Intel.  The Tools Interface Standards Committe has prepared the following 
  476. documents
  477.  
  478.     ftp://ftp.intel.com/pub/IAL/TIS/omf11g.zip
  479. and
  480.     ftp://ftp.intel.com/pub/IAL/TIS/omf11h.zip
  481.  
  482. The readme file in each .zip file states the the document is the
  483. Relocatable Object Module Format Specification, V1.1.  
  484.  
  485. Unfortunately, both files unzip into documents formated for Postscript
  486. printers.  Adobe's Acrobat can not display them, but Ghostscript can.  If
  487. you need GhostScript, you can get it from the following site.  Read the 
  488.     ftp://ftp.cs.wisc.edu/pub/ghost/aladdin 
  489.         (keep trying as I found it difficult connecting to this site)
  490.  
  491. 30.2 MICROSOFT
  492.  
  493. The second is from Microsoft.  This file is located at:
  494.  
  495.     ftp://ftp.microsoft.com/Softlib/MSLFILES/ss0288.exe
  496.  
  497. This file expands into ascii text files that are the Microsoft Product
  498. Support Services Application Note: Relocatable Object Module Format.  These
  499. files date from 1992.  Also include is the .lib file format and the
  500. CodeView extensions. 
  501.  
  502. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  503. Last changed: 9 Jan 96
  504.  
  505. ------------------------------
  506.  
  507. Subject: 31. Rebooting from Software
  508.  
  509. 31.1 WARM AND COLD REBOOT
  510.  
  511. Within DOS, there are two types of rebooting.  There is the warm reboot
  512. that is evoked by pressing the "Ctrl-Alt-Del" key combination.  During this
  513. reboot, all Power On System Tests, POSTs, are performed with the exception
  514. of the memory tests.  In addition to the POSTs, interrupt vectors are
  515. reinitialized and system timers reinitialized.  In other words, the BIOS
  516. code initializes the computer system to such a state that the computer
  517. system is ready for loading the operating system.  The loading of the
  518. operating system is done by issuing an interrupt 19h.
  519.  
  520. The second type of rebooting is a cold reboot that occurs when the system
  521. is turned on.  The only difference between a cold reboot and a warm reboot
  522. is the performing of the memory tests.
  523.  
  524. 31.2 PERFORMING A REBOOT FROM SOFTWARE
  525.  
  526. Whether a cold or warm reboot is performed depends upon the value if the
  527. the reset flat in the ROM BIOS data area.  If this flag is set to 1234h, a
  528. warm reset is performed.  An any other value results in a cold reboot. 
  529. Usually a zero is loaded for the cold reboot.  Code snippets to do this
  530. are:
  531.  
  532. ROMBIOS_DATA    segment at 0400h
  533.     org 72h
  534. ResetFlag   dw  ?
  535. ROMBIOS_DATA    ends
  536.  
  537. ROMBIOS     segment at 0f000h
  538.     org 0fff0h
  539. Reset   label   far
  540. ROMBIOS ends
  541.  
  542. In your code:
  543.  
  544.     mov ax, seg ROMBIOS_DATA
  545.     mov ds, ax
  546. ASSUME ds:ROMBIOS_DATA
  547.     mov ResetFlag, 1234h        ; or 0 if cold reset is desired
  548.     jmp Reset
  549.  
  550. 31.3 WARNINGS!
  551.  
  552. Neither the warm or the cold boot flushes buffers, system, smartdrv, and
  553. EMM386, or notifies TSRs.  This can lead to lost of data.
  554.  
  555. 31.4 JUST USING INT 19H
  556.  
  557. Using this interrupt alone will only reload the operating system onto a
  558. computer system that may not be properly initialized for it.  The interrupt
  559. vectors are not reset but the TSRs that have hooks into the interrupt table
  560. may be overwritten.  Obviously, this can lead to the system hanging if one
  561. of these hooked and overwritten interrupts is called.  Other problems can
  562. be timers not reset or add-on cards not reinitialized properly.  So, do NOT
  563. use int 19h to reboot the computer.
  564.  
  565. 31.5 USING F000:E05B INSTEAD OF F000:FFF0 AS THE JUMP ADDRESS
  566.  
  567. In the original IBM ROM BIOS, the instruction at f000:fff0 was a long jump
  568. to f000:e05b.  Some programs skipped the jump at f000:fff0 and went
  569. directly to the second address which is the start of the reset procedure in
  570. ROM BIOS.  I check my 386 with non IBM BIOS, and the start of the reset
  571. procedure is at the same address.  I believe that using the second address
  572. is dangerous because there is not any guarantee that it will stay the same. 
  573. Also, if you are rebooting the computer what is the reason in saving a few
  574. cycles!  Stay with the address f000:fff0 as the jump there always will take
  575. the execution path to the correct code. 
  576.  
  577. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  578. Last changed: 8 Jan 96
  579.  
  580. ------------------------------
  581.  
  582. Subject: 32. Other FAQs
  583.  
  584. 32.1 COMP.OS.MSDOS.PROGRAMMER
  585.  
  586. This excellent FAQ is posted every 20 days to comp.os.msdos.programmer,
  587. comp.answers and news.answers newsgroup.
  588.  
  589. It is available from
  590.         ftp://rtfm.mit.edu/pub/usenet-by-group/comp.os.msdos.programmer/dos-faq
  591.  
  592. 32.2 COMMUNICATIONS FAQS
  593.  
  594. The following websites contains many links to communication and hardware 
  595. related FAQs, e.g., serial port, game port, keyboard, modem, and LANs. 
  596. Most of these FAQs are not approved FAQs so are not found at rtfm.mit.edu
  597. but that is not to say that these are not quality FAQs.  There is much good
  598. information.
  599.  
  600.     http://www.webcom.com/~llarrow/comfaqs.html
  601.     http://www.paranoia.com/~filipg/HTML/LINK/PORTS/F_Parallel.html
  602.     http://www2.psyber.com/~tcj/resource.html
  603.  
  604. Contributor:  Raymond Moon, raymoon@moonware.dgsys.com
  605. Last changed: 17 Feb 96
  606.  
  607. ------------------------------
  608.  
  609. Subject: 33. Acknowledgments
  610.  
  611. I would like to acknowledge all the people who have assisted me or any of the
  612. contributors.  For their time and effort, this FAQ is a better product.
  613.  
  614. Barry Brey, Kris Heidenstrom, Alan Illeman, Chabad Lubavitch, Jeff Owens,
  615. Russell Schulz, Rocky Seelbach, Janos Szamosfalvi and Cedric Ware 
  616.  
  617.  
  618.  
  619.